package org.chw.netty.handler;

import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * @ClassName: OutPutHandler
 * @Description: 输出处理
 * @Autor: Vincent.Chen
 * @Create: 2018/6/11 17:13
 * @Version: 1.0
 **/
public class OutPutHandler extends Thread {
  private OutputStream ops;

  public OutPutHandler(OutputStream ops) {
    this.ops = ops;
  }

  @Override
  public void run() {
    send();
  }

  public void send() {
    Scanner scanner = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(this.ops);
    boolean flag = true;
    String outStr;
    while (flag) {
      outStr = scanner.next();
      pw.print(outStr);
      pw.flush();
      pw.close();
    }
  }
}
